import Vue from 'vue';
import App from './App';

import Element from 'element-ui';
import Avue from '@smallwei/avue';
import '@smallwei/avue/lib/index.css';
import i18n from './lang'

import router from './router/router';
import VueAxios from 'vue-axios';
import axios from './router/axios';

import store from './store';

import './permission'; // 权限

import * as urls from '@/config/env';
import basicContainer from './components/basic-container/main'

import 'ztree'
import 'ztree/css/zTreeStyle/zTreeStyle.css'

import './styles/common.scss';
import './icons/dzzw/glyph/iconfont.js'
import './icons/dzzw/glyph/dzzw-icon-glyph.min.css'
import './icons/dzzw/outline/iconfont.js'
import './icons/dzzw/outline/dzzw-icon-outline.min.css'

// import Layout from '_c/layout/home'

// import AvueFormDesign from '@/vendors/avue-form-design'
import AvueUeditor from 'avue-plugin-ueditor'

// import vSelectPage from 'v-selectpage'

Vue.use(Element, {
    i18n: (key, value) => i18n.t(key, value)
})
Vue.use(Avue, {
    i18n: (key, value) => i18n.t(key, value)
})

Vue.use(router)
Vue.use(VueAxios, axios)

// Vue.component('layout', Layout)

// Vue.use(AvueFormDesign)
Vue.use(AvueUeditor);

// Vue.use(vSelectPage, {
//   // server side data loader
//   dataLoad: function(vue, data, params){
//     console.log(params)
//     let current = params.pageNumber;
//     let size = params.pageSize;
//     let query = {...params, current, size}
//     return new Promise((resolve, reject)=>{
//       request.post(data, query).then(resp => resolve(resp), resp => reject(resp))
//     })
//   },
//   language: 'cn'
// })

// 加载相关url地址
Object.keys(urls).forEach(key => {
    Vue.prototype[key] = urls[key];
})

//注册全局容器
Vue.component('basicContainer', basicContainer)

// 阻止生成生产提示
Vue.config.productionTip = false;

new Vue({
    router,
    store,
    i18n,
    render: h => h(App)
}).$mount('#app');
